package com.whw.fy.controller;

import com.whw.fy.entity.AttendanceTea;
import com.whw.fy.entity.Message;
import com.whw.fy.service.AttendanceTeaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "教师考勤模块")
@RestController
@RequestMapping("/api/attendanceTea")
public class AttendanceTeaController {
    @Resource
    private AttendanceTeaService attendanceTeaService;

    @ApiOperation(value = "添加考勤信息")
    @PostMapping("/add")
    public Message insert(AttendanceTea attendanceTea) {
        return attendanceTeaService.insertSelective(attendanceTea);
    }

    @ApiOperation(value = "修改考勤信息")
    @PutMapping("/update")
    public Message update(AttendanceTea attendanceTea) {
        return attendanceTeaService.updateByPrimaryKeySelective(attendanceTea);
    }

    @ApiOperation(value = "删除考勤信息")
    @DeleteMapping("/Delete")
    public Message Delete(Integer attTeaId) {
        return attendanceTeaService.deleteByPrimaryKey(attTeaId);
    }

    @ApiOperation(value = "查询所有考勤信息")
    @GetMapping("/all")
    public Message all() {
        return attendanceTeaService.selectAll();
    }

    @ApiOperation(value = "查询")
    @GetMapping("/all/all")
    public Message selectByAll(AttendanceTea attendanceTea){
        return attendanceTeaService.selectByAll(attendanceTea);
    }
}
